import os
from PIL import Image
import cv2
from os.path import join
import shutil


def rename_raw_dataset():
    # source_dir = r'G:\Dataset\rain100\rain_data_train_Heavy\rain\X2'
    # target_dir = r'G:\Dataset\rain100\rain100\Os'
    source_dir = r'G:\Dataset\rain100\rain_data_train_Heavy\norain'
    target_dir = r'G:\Dataset\rain100\rain100\Bs'
    img_list = os.listdir(source_dir)
    for name in img_list:
        new_name = name.replace('x2','')
        new_name = new_name.replace('norain-','')
        print(new_name)
        shutil.copy(join(source_dir,name), join(target_dir,new_name))



if __name__ == '__main__':
    rename_raw_dataset()